<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        {{rever}}
        <button @click="str='i am terrt'">点击我</button>
        <!-- <v-model> 进行双向数据绑定-->
        a--b
        <br>
        <input v-model="a" type="text"><br>
        +
        <br>
        <input v-model="b" type="text"><br>
        =
        <br>
        <output>{{total}}</output>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                str:"i love china",
                

            },
            methods: {},

            computed: {
                rever(){
                    return this.str.split('').reverse().join('')
                },
                total(){
                    return Number(this.a)+Number(this.b)
                }
            },
        })
    </script>
    
</body>
</html>